package com.smcdd.cdb.dbo.cdb_dbo.service.exception;

import rx.Subscriber;

/**
 * 作者：Administrator on 2017/6/30 14:39
 * 邮箱：zhanghuaiha@gmail.com
 */

public abstract class MyObserver<T> extends Subscriber<T> {

    @Override
    public void onError(Throwable e) {
//        e.printStackTrace();
        if(e instanceof ApiException){
            onError((ApiException)e);
        }else{
            onError(new ApiException(e,123,""));
        }
    }

    /**
     * 错误回调
     */
    protected abstract void onError(ApiException ex);
}
